<!doctype html>
<html lang="zh">
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<link rel="stylesheet" type="text/css" href="css/normalize.css" />
		<link rel="stylesheet" type="text/css" href="css/htmleaf-demo.css">
		<link rel="stylesheet" href="css/style.css">
		<title>自动组卷</title>
		<style type="text/css">
			#divA {font-size: 17px; color: gray; text-align: left;}
			#hr1 { border: 3px solid #27323A; color: chocolate; }
			a { text-decoration: none; color: gray; }
			a:hover { color: #2F3238; text-decoration: none; }
			#divB { position: relative; }
			#divB-1 { border: 1px solid #808080; position: relative; top: 30px; left: 10%; width: 500px; height: 500px; }
			table { position: relative; top: 20px; height: 300px; }
			#divC { position: relative; text-align: center; }
		</style>
	</head>
	<body>
		<div id="divA">
			<hr id="hr1" /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<a href="javascript:history.back();">返回</a>&nbsp;&brvbar;&brvbar;<span>&nbsp;自动组卷</span><br /><br />
			<hr id="hr1" />
		</div>
		<div id="divB">
			<div id="divB-1">
			<form id="f1" action="/TestManagementSystem/admin/exempaperServlet/randomGroupExempaper" method="post">
				<table id="tab-1">
					<tr>
						<td style="width: 30%;">所属科目：&nbsp;&nbsp;
							<select name="courseId">
								<option value="请选择">---请选择---</option>
							</select>
						</td>
					</tr>
					<tr>
						<td style="width: 30%;">考试阶段：&nbsp;&nbsp;
							<select name="gradeId">
								<option value="请选择">---请选择---</option>
							</select>
						</td>
					</tr>
					<tr>
						<td style="width: 30%;">试卷标题：&nbsp;&nbsp;
							<input type="text" name=examPaperName style="width: 103px;" />
						</td>
					</tr>
					<tr>
						<td style="width: 30%;">考试时长：&nbsp;&nbsp;
							<input type="text" name="examPaperTestTime" style="width: 103px;" />&nbsp;&nbsp;分钟
						</td>
					</tr>
					<tr>
						<td style="width: 30%;">试题总分：&nbsp;&nbsp;
							<input type="text" name="examPaperTotalScore" style="width: 103px;" />&nbsp;&nbsp;分
						</td>
					</tr>
					<tr>
						<td style="width: 30%;">总题数：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<input type="text" name="examPaperTestNum" style="width: 103px;" />
						</td>
					</tr>
					<tr>
						<td style="width: 30%;">出卷人：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<font id="create_project_name">张三</font>
						</td>
					</tr>
				</table><br /><br />
				<div id="divC">
					<hr id="hr2" /><input type="submit" value="生成试卷"/>
				</div>
				</form>
				
			</div>
		</div>
		
	</body>
	<script type="text/javascript" src="/TestManagementSystem/js/jquery-1.4.1.js" ></script>
	<script type="text/javascript">
	$(function(){
		sendajax();
	});
	function sendajax(){
		$.ajax({
			url:"http://localhost:8080/TestManagementSystem/admin/exempaperServlet/showMsg", //发送请求的地址
			dataType:"json",
			success:function(data){ 
				showSource(data);
			}
		});	
	}
	/*
	显示数据
	*/
	function showSource(datas){
		for(var i = 0; i < datas.length; i++){
		var data = datas[i];
		if(null==data.gradeId){
			// 科目实体
			$("select[name=courseId]").append("<option value="+data.courseId+">"+data.courseName+"</option>");
			
		}else{
			// 年级实体
			$("select[name=gradeId]").append("<option value="+data.gradeId+">"+data.gradeName+"</option>");
		}
	}
}
	</script>
</html>